Skip to content

add support for NCDatasets.jl - #68

Open
bjarthur wants to merge 2 commits into
JuliaDataCubes:masterfrom
bjarthur:bja/ncdatasets
Open

bjarthur wants to merge 2 commits into
JuliaDataCubes:masterfrom
bjarthur:bja/ncdatasets

Conversation

@bjarthur

@bjarthur bjarthur commented Jul 22, 2026

Copy link
Copy Markdown

given that NetCDF.jl is no longer maintained...

@bjarthur
bjarthur marked this pull request as ready for review July 24, 2026 12:37
@bjarthur

Copy link
Copy Markdown
Author

@mkitti

@bjarthur

Copy link
Copy Markdown
Author

should probably wait to merge this until zstd compression is sorted out. see JuliaGeo/NCDatasets.jl#317

The extension read and wrote through NCDatasets' CFVariable, so the CF
decoding (scale_factor, add_offset, fill values, time units) was applied
twice: once by NCDatasets and again by YAXArrays' CFDiskArray/timedecode.
A variable with scale_factor 0.5 and add_offset 100 came back as 150.5
instead of 101, and a "days since" time axis got a corrupt element type.
Wrap the raw Variable (nc[name].var) instead, as the NetCDF.jl backend
does, and copy _FillValue into missing_value so YAXArrays honours it.

Also:
- forward haschunks/eachchunk to the file (they were imported but never
  defined, so every handle fell back to a single whole-array chunk)
- iscompressed recognises Zstandard when NCDatasets provides zstandard()
- open_dataset_handle no longer masks a failed open with close(nothing)
- add_var passes deflate/zstd keywords only when requested, so zstdlevel
  never reaches a defVar that does not know it
- allow_missings is false: defVar wants a DataType, and YAXArrays handles
  Union{Missing,T} through missing_value as for NetCDF.jl
- NCDatasets compat is "0.14"; 0.12 predates the DiskArrays integration
- tests: chunking, failed-open and raw-value/attribute round trip

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant